xen: Boot on PAE systems with no EFER MSR.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 5 Jun 2007 09:28:59 +0000 (10:28 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 5 Jun 2007 09:28:59 +0000 (10:28 +0100)
Bug tracked down by Stefan Berger.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/boot/trampoline.S

index 6df2ba8c02d2c8e26706eb3b533711cef5f7b3b3..0eb9dcee8c3a4986dfc90da0e0328a3485e490c8 100644 (file)
@@ -60,17 +60,20 @@ trampoline_protmode_entry:
 
 #if CONFIG_PAGING_LEVELS != 2
         /* Set up EFER (Extended Feature Enable Register). */
+        mov     SYM_TRAMP_PHYS(cpuid_ext_features),%edi
+        test    $0x20100800,%edi /* SYSCALL/SYSRET, No Execute, Long Mode? */
+        jz      .Lskip_efer
         movl    $MSR_EFER,%ecx
         rdmsr
 #if CONFIG_PAGING_LEVELS == 4
         btsl    $_EFER_LME,%eax /* Long Mode      */
         btsl    $_EFER_SCE,%eax /* SYSCALL/SYSRET */
 #endif
-        mov     SYM_TRAMP_PHYS(cpuid_ext_features),%edi
-        btl     $20,%edi        /* CPUID 0x80000001, EDX[20] */
+        btl     $20,%edi        /* No Execute?    */
         jnc     1f
-        btsl    $_EFER_NX,%eax  /* No-Execute     */
+        btsl    $_EFER_NX,%eax  /* No Execute     */
 1:      wrmsr
+.Lskip_efer:
 #endif
 
         mov     $0x80050033,%eax /* hi-to-lo: PG,AM,WP,NE,ET,MP,PE */